//	--------------------------------------------------------------------
//	Copyright(C) 2006,2007 Zhao Yukun. All rights reserved.
//	This file is a part of the Xeres system.
//	Xeres 2007
//	Contact : xeres.engine@gmail.com
//	$(reservedInfo)
//	$(reservedDeclaration)
//	--------------------------------------------------------------------
///	@file	<IShaderAdapter.h>
///	@path	~/src/graphics/
///	@date	2008/12/27
///	@desc	.

#pragma once

#include "xeres.h"

#include "graphics/IDevice.h"
#include "graphics/IShader.h"

namespace xeres {

	// forward declaration
	class IGeometry;

	/*!	
		\class	IShaderAdapter
		\brief
	*/
	class IShaderAdapter : public IObject
	{
	public:

		/// \ctor
		IShaderAdapter( void );

		/// \dtor
		virtual ~IShaderAdapter( void );

		DECL_IOBJECT_INTERFACE( IShaderAdapter , IObject );

	public:
		
		/// \name Shader Adapter Interface
		//@{

		/*! 
			\brief	Get adapted technique.
		*/
		virtual RefWeak<IShader> AdaptShader( RenderContext& rc ) = 0;

		/*! 
			\brief	Assemble shader (only valid in DX10 mode).
		*/
		virtual void AssembleShader( RenderContext& rc ) = 0;

		/*! 
			\brief	Draw geometry with adapted shader.
		*/
		virtual void Draw( RenderContext& rc , RefWeak<IGeometry> geo ) = 0;

		//@}
	};
	
} // namespace xeres
